package com.github.skystardust.lotteryex.lottery.item.imp.award;

import com.github.skystardust.lotteryex.lottery.item.AwardItem;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import java.util.Map;
import java.util.UUID;

@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AwardItemItem extends AwardItem<ItemStack> {
    public AwardItemItem(ItemStack awardItem) {
        super(awardItem);
    }

    public AwardItemItem(UUID uuid, ItemStack awardItem) {
        super(uuid, awardItem);
    }

    public AwardItemItem(Map<String, Object> stringObjectMap) {
        super(stringObjectMap);
        setAwardItem(((ItemStack) stringObjectMap.get("awardItem")));
    }

    @Override
    public void giveAward(Player player) {
        player.getInventory().addItem(getAwardItem());
    }
}
